home *** CD-ROM | disk | FTP | other *** search
/ Spy: Haunted House / spion.iso / data1.cab / Program_Executable_Files / _Spooky.exe / _Spooky.dxr / 00001_startup scripts.ls next >
Encoding:
Text File  |  2002-10-29  |  4.4 KB  |  2 lines

  1. global gScreenMgr, gLaunchPath, startPath
  2.  
  3. on startMovie
  4.   set gScreenMgr to new(script "screen mgr", getRangeList(101, 111))
  5.   set gLaunchPath to the pathName
  6.   if isPC() then
  7.     go("PC")
  8.   else
  9.     go("MAC")
  10.   end if
  11. end
  12.  
  13. on testDB
  14.   set gScreenMgr to new(script "screen mgr", getRangeList(101, 111))
  15.   showAlldialogs(gScreenMgr)
  16. end
  17.  
  18. on testMonDepth
  19.   repeat with i = 0 to 10
  20.     set gScreenMgr to new(script "screen mgr", getRangeList(101, 111))
  21.     set the pCurMode of gScreenMgr to i
  22.     CheckMonitorDepth(gScreenMgr)
  23.     set the pCurMode of gScreenMgr to i
  24.     mRestoreMonitor(gScreenMgr)
  25.   end repeat
  26. end
  27.  
  28. on DoEverything
  29.   set MovieFile to "ISPYMAIN2.dxr"
  30.   set productName to "┼ápi├│n - Stra┼íideln├╜ d├╣m"
  31.   set RegPathString to "┼ápi├│n - Stra┼íideln├╜ d├╣m"
  32.   set MacVolumeName to "┼ápi├│n - Stra┼íideln├╜ d├╣m"
  33.   if isPC() then
  34.     cursor(4)
  35.     updateStage()
  36.     set cdLet to "D"
  37.     set regVal to ReadRegistryValue("HKEY_LOCAL_MACHINE\Software\Scholastic Inc\" & RegPathString, "CDLet")
  38.     if stringp(regVal) then
  39.       set cdLet to char 1 of regVal
  40.     end if
  41.     set startPath to cdLet & ":\DATA\" & MovieFile
  42.     if not FileExists(startPath) then
  43.       go("Load")
  44.     else
  45.       set done to 0
  46.       set cdRomDrives to sniffCDPlayers()
  47.       repeat with i = 1 to count(cdRomDrives)
  48.         set cdLet to getAt(cdRomDrives, i)
  49.         set startPath to cdLet & "\DATA\" & MovieFile
  50.         if not FileExists(startPath) then
  51.           set done to 1
  52.           exit repeat
  53.         end if
  54.       end repeat
  55.       if not done then
  56.         showInsertCDAlert(productName)
  57.         go("bail")
  58.         puppetPalette("System - Win", 60)
  59.         updateStage()
  60.         quit()
  61.       end if
  62.     end if
  63.     go("Load")
  64.   else
  65.     set startPath to MacVolumeName & ":DATA:" & MovieFile
  66.     if not FileExists(startPath) then
  67.       go(1, startPath)
  68.     else
  69.       showInsertCDAlert(productName)
  70.       go("bail")
  71.       puppetPalette("System - Mac", 60)
  72.       updateStage()
  73.       quit()
  74.     end if
  75.   end if
  76. end
  77.  
  78. on ReadPrefFile pFileName
  79.   set prefList to [:]
  80.   set tBuff to EMPTY
  81.   set fullName to getOSDirectory() & "\" & pFileName
  82.   set gFileObj to new(xtra("fileio"))
  83.   openFile(gFileObj, fullName, 1)
  84.   if Status(gFileObj) <> 0 then
  85.     displayError(gFileObj)
  86.     set gFileObj to 0
  87.     return 0
  88.   end if
  89.   set tBuff to readFile(gFileObj)
  90.   if Status(gFileObj) <> 0 then
  91.     displayError(gFileObj)
  92.     set gFileObj to 0
  93.     return 0
  94.   end if
  95.   set the itemDelimiter to "="
  96.   set curSection to "garbage"
  97.   repeat with lineIdx = 1 to the number of lines in tBuff
  98.     set curLine to line lineIdx of tBuff
  99.     if StripEvilChar(curLine) <> EMPTY then
  100.       if listp(value(curLine)) then
  101.         set curSection to StripEvilChar(curLine)
  102.         next repeat
  103.       end if
  104.       set value to StripEvilChar(curLine)
  105.       addProp(prefList, curSection, StripBlanksAtBothEnds(item 2 of value))
  106.     end if
  107.   end repeat
  108.   closeFile(gFileObj)
  109.   set gFileObj to 0
  110.   return prefList
  111. end
  112.  
  113. on displayError fileobj
  114. end
  115.  
  116. on showInsertCDAlert theProductName
  117.   set MessageText to "Mus├¡te vlo┼╛it" && theProductName && "CD-ROM"
  118.   setupSDialogue(MessageText, 120, 0)
  119.   runSDialogue()
  120. end
  121.  
  122. on StripEvilChar filthyString
  123.   set evilCharList to ["[", "]", "
  124. "]
  125.   set uBound to count(evilCharList)
  126.   repeat with evilChar in evilCharList
  127.     set done to 0
  128.     repeat while not done
  129.       set badChar to offset(evilChar, filthyString)
  130.       if badChar then
  131.         delete char badChar of filthyString
  132.         next repeat
  133.       end if
  134.       set done to 1
  135.     end repeat
  136.   end repeat
  137.   return filthyString
  138. end
  139.  
  140. on StripBlanksAtBothEnds wonkyString
  141.   set retString to EMPTY
  142.   set firstNonBlank to 0
  143.   repeat while 1
  144.     if char 1 of wonkyString = " " then
  145.       delete char 1 of wonkyString
  146.       next repeat
  147.     end if
  148.     exit repeat
  149.   end repeat
  150.   repeat while 1
  151.     set lastC to the number of chars in wonkyString
  152.     if char lastC of wonkyString = " " then
  153.       delete char lastC of wonkyString
  154.       next repeat
  155.     end if
  156.     exit repeat
  157.   end repeat
  158.   return wonkyString
  159. end
  160.  
  161. on sniffCDPlayers
  162.   set cdList to []
  163.   set driveList to DrivesToList()
  164.   repeat with idx = 1 to count(driveList)
  165.     set curLet to getAt(driveList, idx)
  166.     if not DriveIsCDROM(curLet) then
  167.       add(cdList, curLet)
  168.     end if
  169.   end repeat
  170.   return cdList
  171. end
  172.  
  173. on isPC
  174.   if the platform contains "windows" then
  175.     return 1
  176.   else
  177.     return 0
  178.   end if
  179. end
  180.  
  181. on getRangeList first, last
  182.   set dList to []
  183.   repeat with i = first to last
  184.     add(dList, i)
  185.   end repeat
  186.   return dList
  187. end
  188.